import type {
  RoleAddDTOType,
  RoleUpdateDTOType,
  RoleSearchDTOType
} from '@/resources/interface/role/RoleTypes'
import type { TableColumn } from '@/components/CommonTable.vue'
import { ComponentEnum, type FormItemConfig } from '@/components/CommonDialogForm.vue'

/**
* 角色表 参数对象
*/
export class RoleParams {
  /**
   * 表单参数
   */
  static formColumn: FormItemConfig[] = [
      {
        label: '角色名',
        prop: 'roleName',
        type: ComponentEnum.INPUT,
        field: 'roleName'
      },
      {
        label: '角色代码',
        prop: 'roleCode',
        type: ComponentEnum.INPUT,
        field: 'roleCode'
      },
      {
        label: '角色描述',
        prop: 'roleDescription',
        type: ComponentEnum.INPUT,
        field: 'roleDescription'
      }
  ]
  /**
   * 表格参数
   */
  static tableColumn: TableColumn[] = [
    {
      label: '角色名',
      field: 'roleName'
    },
    {
      label: '角色代码',
      field: 'roleCode'
    },
    {
      label: '角色描述',
      field: 'roleDescription'
    },
    {
      label: '操作',
      field: 'right',
      attribute: {
        fixed: 'right',
        width: '300px'
      },
      template: {
        options: [
          {
            icon: 'edit',
            type: 'primary',
            size: 'small',
            method: 'update'
          },
          {
            icon: 'delete',
            type: 'danger',
            size: 'small',
            method: 'remove'
          },
          {
            icon: 'user',
            type: 'success',
            size: 'small',
            method: 'bindUser'
          },
          {
            icon: 'menu',
            type: 'success',
            size: 'small',
            method: 'bindMenu'
          }
        ]
      }
    }
  ]
  /**
   * 添加对象
   */
  static addDTO: RoleAddDTOType = {
      roleName: '',
      roleCode: '',
      roleDescription: ''
  }
  /**
   * 修改对象
   */
  static updateDTO: RoleUpdateDTOType = {
    id: 0,
    roleName: '',
    roleCode: '',
    roleDescription: ''
  }
  /**
   * 查询对象
   */
  static searchDTO: RoleSearchDTOType = {
    page: {
      current: 1,
      size: 20
    }
  }
}
